package com.xwaf.platform.system.auth.task.data;

import java.io.Serializable;
import java.util.Locale;

import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import com.xwaf.platform.common.api.entity.ELUser;

import lombok.Data;

/**
 * 
 * <p>
 * 单个导入数据存储
 * <p>
 * 
 * @author 李聪 <br>
 * @email xwaf_love@yeah.net <br>
 * @since JDK 1.8<br>
 * @date 2020年1月4日 下午1:19:16 <br>
 * @see 无<br>
 *      Copyright (c) 2020, xwaf_love@yeah.net All Rights Reserved.<br>
 */
@Data
public class ImportData implements Serializable {
	private static final long serialVersionUID = 1L;

	private String id;// 日志ID
	private String filePath;// 绝对路径
	private String fileName;// 文件名
	private String saveErrorUrl;// 错误文件路径
	private String saveErrorFile;// 错误的文件路径名
	private ELUser user;
	private ApplicationContext ctx;
	private Locale local;
	private String strType;// 导入类型
	private ThreadPoolTaskExecutor importTaskExecutor;
	private ImportIingType importingType;// 导入进度

	public enum ImportIingType {
		READY, // 导入读取成功
		IMPORTING, // 正在导入
		FINISH;// 导入完成
	}

	/**
	 * 订单导入
	 */
	public ImportData(String id, String filePath, String fileName, String saveErrorUrl, String saveErrorFile,
			ELUser user, ApplicationContext ctx, Locale local, ThreadPoolTaskExecutor importTaskExecutor,
			String strType) {
		this.id = id;
		this.filePath = filePath;
		this.fileName = fileName;
		this.saveErrorUrl = saveErrorUrl;
		this.saveErrorFile = saveErrorFile;
		this.user = user;
		this.ctx = ctx;
		this.local = local;
		this.strType = strType;
		this.importTaskExecutor = importTaskExecutor;
		this.importingType = ImportIingType.READY;
	}
}
